package com.ionehe.group.common.io;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;
import java.util.Date;

/**
 * Copyright (c) 2020 ionehe.com
 * Date: 2020/9/22
 * Time: 下午10:35
 *
 * @author 2020年 <a href="mailto:a@ionehe.com">秀</a>
 */
public class ResponseNullTimestampSerializer extends JsonSerializer<Date> {
    public ResponseNullTimestampSerializer() {
    }

    @Override
    public void serialize(Date value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        gen.writeString("" + System.currentTimeMillis());
    }
}
